
import threading
import time
def run(n):
   global num
   num += 1
num = 0
listt = []
for i in range(50):
    t = threading.Thread(target=run,args=("t- %s"%i,))
    t.start()
    listt.append(t)
for t in listt:
    t.join()

print('-----all threads finished----',threading.current_thread(),threading.active_count())
print('num',num)